using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using System.Data;using THSERP.BusinessEntities;using THSERP.BaseProvider;

namespace THSERP.Modules.Report
{
    public partial class HRRP019EmployeesGridControl : THSGridControl
    {
        protected override DevExpress.XtraGrid.Views.Grid.GridView InitializeGridView()
        {
            DevExpress.XtraGrid.Views.Grid.GridView gridView = base.InitializeGridView();
            gridView.OptionsView.ShowFooter = true;
            gridView.OptionsBehavior.Editable = false;

            DevExpress.XtraGrid.Columns.GridColumn col = gridView.Columns["HREmployeeTotalSale"];
            col.SummaryItem.FieldName = "HREmployeeTotalSale";
            col.SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Sum;
            col.SummaryItem.DisplayFormat = "{0:n2}";

            DevExpress.XtraGrid.Columns.GridColumn colQty = gridView.Columns["HREmployeeTotalQty"];
            colQty.SummaryItem.FieldName = "HREmployeeTotalQty";
            colQty.SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Sum;
            colQty.SummaryItem.DisplayFormat = "{0:n0}";

            return gridView;
        }

        protected override void AddColumnsToGridView(string strTableName, DevExpress.XtraGrid.Views.Grid.GridView gridView)
        {
            base.AddColumnsToGridView(strTableName, gridView);

            DevExpress.XtraGrid.Columns.GridColumn col = new DevExpress.XtraGrid.Columns.GridColumn();
            col.Name = "colHREmployeeTotalSale";
            col.FieldName = "HREmployeeTotalSale";
            col.Caption = "Total Sale";
            col.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
            col.DisplayFormat.FormatString = "{0:n2}";
            gridView.Columns.Add(col);

            col = new DevExpress.XtraGrid.Columns.GridColumn();
            col.Name = "colHREmployeeTotalQty";
            col.FieldName = "HREmployeeTotalQty";
            col.Caption = "Qty";
            col.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
            col.DisplayFormat.FormatString = "{0:n0}";
            gridView.Columns.Add(col);
        }
    }
}
